package com.school.zhaoban.service.impl;

import com.school.zhaoban.pojo.User;
import com.school.zhaoban.mapper.UserMapper;
import com.school.zhaoban.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 又菜又爱玩
 * @since 2022-02-11
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Override
    public List<User> findAll() {
        return baseMapper.selectList(null);
    }

    @Override
    public User findByID(String id) {
        return baseMapper.selectById(id);
    }

    @Override
    public int saveUser(User user) {
        int i = baseMapper.insert(user);
        return i;
    }
}
